package org.tissou.client.Panel_Premier.import_tab;

import org.tissou.client.Interface.Base_Panel;
import org.tissou.client.Services.importer.RecupererTransactionsAsync;
import org.tissou.client.Services.importer.RecupererTransactions;
import org.tissou.client.DonneesAAfficher.Donnees_Base;
import org.tissou.client.DonneesAAfficher.Tableau;
import org.tissou.client.DonneesAAfficher.TableauAImporter;
import com.google.gwt.user.client.ui.*;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Created by IntelliJ IDEA.
 * User: Claire
 * Date: 27-Apr-2009
 * Time: 22:41:04
 * To change this template use File | Settings | File Templates.
 */
public class TAB_Importation extends Base_Panel {
  DockPanel principal = new DockPanel();


  protected void MiseEnPlaceStyles() {
  }

  protected void MiseEnPlaceParametresWidgets() {

  }

  protected void MiseEnPlaceParametresPanel() {

  }

  protected void MiseEnPlaceActions() {

  }

  protected void MiseEnPlacePanels() {

  }

  protected Panel donneLePanelPrincipal() {
    return principal;
  }

  public void jeTeCliqueSurLaGueule() {
    RecupererTransactions.App.getInstance().recupererTransactions(new AsyncCallback<Donnees_Base>() {

      public void onFailure(Throwable caught) {
        principal.add(new HTML(caught.getLocalizedMessage()));
      }

      public void onSuccess(Donnees_Base result) {
        TableauAImporter tab = new TableauAImporter(result);
        tab.afficherDans(principal, DockPanel.NORTH);
      }
    });
  }
}